package org.smile.db.handler;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;

public class ArrayRowHandler implements RowHandler {

	/**
	 * 转换为数组
	 */
	public Object handle(ResultSet rs) throws SQLException {
        ResultSetMetaData rsmd = rs.getMetaData();
        int cols = rsmd.getColumnCount();
        Object[] result=new Object[cols];
        for (int i = 1; i <= cols; i++) {
            result[i-1]=rs.getObject(i);
        }
        return result;
	}

}
